/*
 * @Desc:用户token等相关cookie信息
 * @author cheegon
 * @date 2022/7/25  10:54
**/
import Cookies from 'js-cookie'
import { curr_env } from '@/config/envConfig'
import globalConfig from '@/config/globalConfig.js'

const KEY_HEAD = `${ globalConfig.appName }_${ curr_env.envName }_`

/**
 * 登录的token
 */
export const LOGIN_TOKEN = KEY_HEAD + 'login_token'

export function getToken() {
    return Cookies.get(LOGIN_TOKEN)
}

export function setToken(token) {
    return Cookies.set(LOGIN_TOKEN, token)
}

export function removeToken() {
    return Cookies.remove(LOGIN_TOKEN)
}
